package com.ibs.hadoop.hbase.service.complaint.impl;

import java.util.List;

import com.ibs.hadoop.hbase.bean.DetachBean;
import com.ibs.hadoop.hbase.bean.QueryBean;
import com.ibs.hadoop.hbase.bean.UseComplaintBaseClass;
import com.ibs.hadoop.hbase.dao.impl.DeatchDaoImpl;
import com.ibs.hadoop.hbase.service.complaint.UserComplaintDataQuery;

/**
 * 用户投诉查询
* 源文件名：UserComplaintAttachQuery.java
* 文件版本：1.0.0
* 创建作者：Think
* 创建日期：2016年10月31日
* 修改作者：Think
* 修改日期：2016年10月31日
* 文件描述：TODO
* 版权所有：Copyright 2016 zjhz, Inc. All Rights Reserved.
*/
public class UserComplaintDeatchQuery implements UserComplaintDataQuery {

    private static final UserComplaintDeatchQuery INSTANCE = new UserComplaintDeatchQuery();

    public static UserComplaintDataQuery getInstance() {
        return INSTANCE;
    }

    @Override
    public List<UseComplaintBaseClass> query(QueryBean query) {
        return DeatchDaoImpl.getInstance().query(query);

    }

    @Override
    public String parseLine(UseComplaintBaseClass userComplatin) {

        DetachBean param = (DetachBean) userComplatin;

        StringBuilder result = new StringBuilder();

        result.append("Frame").append(":").append(param.getFrame()).append(",");
        result.append("Ttime").append(":").append(param.getTtime()).append(",");
        result.append("EnbId").append(":").append(param.getEnbId()).append(",");
        result.append("Ci").append(":").append(param.getCi()).append(",");
        result.append("Tac").append(":").append(param.getTac()).append(",");
        result.append("Imsi").append(":").append(param.getImsi()).append(",");
        result.append("MTmsi").append(":").append(param.getMTmsi()).append(",");
        result.append("Mmecode").append(":").append(param.getMmecode()).append(",");
        result.append("ResponseTime").append(":").append(param.getResponseTime()).append(",");
        result.append("Direction").append(":").append(param.getDirection()).append(",");
        result.append("Success").append(":").append(param.getSuccess()).append(",");
        result.append("FailureCause").append(":").append(param.getFailureCause()).append(",");
        result.append("RecordFileIndex").append(":").append(param.getRecordFileIndex()).append(",");
        result.append("LastFileindex").append(":").append(param.getLastFileindex()).append(",");
        result.append("EnbIp").append(":").append(param.getEnbIp()).append(",");
        result.append("MmeIp").append(":").append(param.getMmeIp()).append(",");
        result.append("DetachType").append(":").append(param.getDetachType()).append(",");
        result.append("EmmCause").append(":").append(param.getEmmCause()).append(",");
        result.append("Lasttime").append(":").append(param.getLasttime()).append(",");
        result.append("RatType").append(":").append(param.getRatType()).append(",");
        result.append("Enb").append(":").append(param.getEnb()).append(",");
        result.append("Mme").append(":").append(param.getMme()).append(",");
        result.append("UlTeid").append(":").append(param.getUlTeid()).append(",");
        result.append("DlTeid").append(":").append(param.getDlTeid()).append(",");
        result.append("SGwIpS1").append(":").append(param.getSGwIpS1()).append(",");
        result.append("EnbTransaddr").append(":").append(param.getEnbTransaddr()).append(",");
        result.append("ZoneId").append(":").append(param.getZoneId()).append(",");

        return result.toString();
    }

}
